import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:flutter_application_1/siginin.dart';

class RegisterPage extends StatefulWidget {
  RegisterPage({Key key}) : super(key: key);

  _RegisterPageState createState() {
    return _RegisterPageState();
  }
}

class _RegisterPageState extends State<RegisterPage> {
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: AppBar(
        title: Text('注册'),
      ),
      body: new Column(
        children: [
          Padding(
            padding: EdgeInsets.all(15),
            child: TextField(
              decoration: InputDecoration(labelText: '请输入账号'),
              // prefixIcon: Icon(Icons.people),
              autofocus: false,
            ),
          ),
          Padding(
            padding: EdgeInsets.all(15),
            child: TextField(
              decoration: InputDecoration(labelText: '请输入密码'),
            ),
          ),
          Row(
            children: [
              Padding(
                padding: EdgeInsets.all(15),
                child: TextButton(
                  child: Text('已有帐号，返回登录'),
                  onPressed: () {
                    // Navigator.push(
                    //   context,
                    //   MaterialPageRoute(
                    //     builder: (BuildContext context) {
                    //       return SigninPage();
                    //     },
                    //   ),
                    // );
                    Navigator.pop(context);
                  },
                ),
              ),
            ],
          ),
          Padding(
            padding: EdgeInsets.all(15),
            child: new SizedBox(
              width: double.infinity, // 设置宽度无限长 但不会超过父容器宽度
              child: ElevatedButton(
                style: ElevatedButton.styleFrom(
                  textStyle: TextStyle(
                    fontSize: 18,
                    color: Colors.white,
                    backgroundColor: Colors.blue,
                  ),
                ),
                child: Text('注册'),
                onPressed: () {
                  Fluttertoast.showToast(
                    msg: "请输入账号",
                    toastLength: Toast.LENGTH_SHORT,
                    gravity: ToastGravity.BOTTOM,
                    timeInSecForIosWeb: 1,
                    backgroundColor: Colors.black45,
                    textColor: Colors.white,
                    fontSize: 16.0,
                  );
                },
              ),
            ),
          ),
        ],
      ),
    );
  }
}
